\(\int \frac {\csc (a+b \log (c x^n))}{x} \, dx\) [292]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 20 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\text {arctanh}\left (\cos \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \]

[Out]

-arctanh(cos(a+b*ln(c*x^n)))/b/n

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3855} \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\text {arctanh}\left (\cos \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \]

[In]

Int[Csc[a + b*Log[c*x^n]]/x,x]

[Out]

-(ArcTanh[Cos[a + b*Log[c*x^n]]]/(b*n))

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \csc (a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n} \\ & = -\frac {\text {arctanh}\left (\cos \left (a+b \log \left (c x^n\right )\right )\right )}{b n} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(54\) vs. \(2(20)=40\).

Time = 0.05 (sec) , antiderivative size = 54, normalized size of antiderivative = 2.70 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\log \left (\cos \left (\frac {a}{2}+\frac {1}{2} b \log \left (c x^n\right )\right )\right )}{b n}+\frac {\log \left (\sin \left (\frac {a}{2}+\frac {1}{2} b \log \left (c x^n\right )\right )\right )}{b n} \]

[In]

Integrate[Csc[a + b*Log[c*x^n]]/x,x]

[Out]

-(Log[Cos[a/2 + (b*Log[c*x^n])/2]]/(b*n)) + Log[Sin[a/2 + (b*Log[c*x^n])/2]]/(b*n)

Maple [A] (verified)

Time = 0.40 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.20

method result size
parallelrisch \(\frac {\ln \left (\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )\right )}{b n}\) \(24\)
derivativedivides \(-\frac {\ln \left (\csc \left (a +b \ln \left (c \,x^{n}\right )\right )+\cot \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{n b}\) \(33\)
default \(-\frac {\ln \left (\csc \left (a +b \ln \left (c \,x^{n}\right )\right )+\cot \left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{n b}\) \(33\)
risch \(\frac {\ln \left (c^{i b} \left (x^{n}\right )^{i b} {\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}-1\right )}{b n}-\frac {\ln \left (c^{i b} \left (x^{n}\right )^{i b} {\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}+1\right )}{b n}\) \(227\)

[In]

int(csc(a+b*ln(c*x^n))/x,x,method=_RETURNVERBOSE)

[Out]

ln(tan(1/2*a+b*ln((c*x^n)^(1/2))))/b/n

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (20) = 40\).

Time = 0.25 (sec) , antiderivative size = 45, normalized size of antiderivative = 2.25 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\log \left (\frac {1}{2} \, \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + \frac {1}{2}\right )}{2 \, b n} \]

[In]

integrate(csc(a+b*log(c*x^n))/x,x, algorithm="fricas")

[Out]

-1/2*(log(1/2*cos(b*n*log(x) + b*log(c) + a) + 1/2) - log(-1/2*cos(b*n*log(x) + b*log(c) + a) + 1/2))/(b*n)

Sympy [A] (verification not implemented)

Time = 1.03 (sec) , antiderivative size = 49, normalized size of antiderivative = 2.45 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=- \begin {cases} - \log {\left (x \right )} \csc {\left (a \right )} & \text {for}\: b = 0 \\- \log {\left (x \right )} \csc {\left (a + b \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\\frac {\log {\left (\cot {\left (a + b \log {\left (c x^{n} \right )} \right )} + \csc {\left (a + b \log {\left (c x^{n} \right )} \right )} \right )}}{b n} & \text {otherwise} \end {cases} \]

[In]

integrate(csc(a+b*ln(c*x**n))/x,x)

[Out]

-Piecewise((-log(x)*csc(a), Eq(b, 0)), (-log(x)*csc(a + b*log(c)), Eq(n, 0)), (log(cot(a + b*log(c*x**n)) + cs
c(a + b*log(c*x**n)))/(b*n), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.60 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=-\frac {\log \left (\cot \left (b \log \left (c x^{n}\right ) + a\right ) + \csc \left (b \log \left (c x^{n}\right ) + a\right )\right )}{b n} \]

[In]

integrate(csc(a+b*log(c*x^n))/x,x, algorithm="maxima")

[Out]

-log(cot(b*log(c*x^n) + a) + csc(b*log(c*x^n) + a))/(b*n)

Giac [F]

\[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\int { \frac {\csc \left (b \log \left (c x^{n}\right ) + a\right )}{x} \,d x } \]

[In]

integrate(csc(a+b*log(c*x^n))/x,x, algorithm="giac")

[Out]

integrate(csc(b*log(c*x^n) + a)/x, x)

Mupad [B] (verification not implemented)

Time = 28.95 (sec) , antiderivative size = 68, normalized size of antiderivative = 3.40 \[ \int \frac {\csc \left (a+b \log \left (c x^n\right )\right )}{x} \, dx=\frac {\ln \left (\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}\,2{}\mathrm {i}-2{}\mathrm {i}}{x}\right )}{b\,n}-\frac {\ln \left (\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}\,2{}\mathrm {i}+2{}\mathrm {i}}{x}\right )}{b\,n} \]

[In]

int(1/(x*sin(a + b*log(c*x^n))),x)

[Out]

log((exp(a*1i)*(c*x^n)^(b*1i)*2i - 2i)/x)/(b*n) - log((exp(a*1i)*(c*x^n)^(b*1i)*2i + 2i)/x)/(b*n)